package org.paic.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogUtils {

    public static Logger getLogger(String str) {
        return LoggerFactory.getLogger(str);
    }

    private static Logger logger = LoggerFactory.getLogger(LogUtils.class);

    public static void d(Object msg) {
        logger.debug(msg == null ? "null" : msg.toString());
    }

    public static void i(Object msg) {
        logger.info(msg == null ? "null" : msg.toString());
    }

    public static void w(Object msg) {
        logger.warn(msg == null ? "null" : msg.toString());
    }

    public static void e(String msg, Throwable t) {
        logger.error(msg, t);
    }

    public static String concatStr(String... strs) {
        StringBuilder sb = new StringBuilder();

        for (String str : strs) {
            sb.append(str);
        }

        return sb.toString();
    }
}
